package com.zhu.oj.judge.codeSandBox.impl;

import com.zhu.oj.judge.codeSandBox.CodeSandBox;
import com.zhu.oj.judge.codeSandBox.model.ExecuteCodeRequest;
import com.zhu.oj.judge.codeSandBox.model.ExecuteCodeResponse;
import com.zhu.oj.model.dto.questionsubmit.JudgeInfo;
import com.zhu.oj.model.enums.JudgoInfeMessageEnum;
import com.zhu.oj.model.enums.QuestionSubmitStatusEnum;

import java.util.List;

/*
仅为了跑通业务的接口
 */

public class ExampleCodeSandBox implements CodeSandBox {
    @Override
    public ExecuteCodeResponse executeCode(ExecuteCodeRequest executeCodeRequest) {
        List<String> inputList = executeCodeRequest.getInputList();

        ExecuteCodeResponse executeCodeResponse = new ExecuteCodeResponse();
        executeCodeResponse.setOutputList(inputList);
        executeCodeResponse.setMessage("测试执行成功");
        JudgeInfo judgeInfo = new JudgeInfo();
        judgeInfo.setMessage(JudgoInfeMessageEnum.ACCEPTED.getText());
        judgeInfo.setMemory(100L);
        judgeInfo.setTime(100L);
        executeCodeResponse.setJudgeInfo(judgeInfo);
        executeCodeResponse.setStatus(QuestionSubmitStatusEnum.SUCCESS.getValue());

        return executeCodeResponse;
    }
}
